package main

import (
	"fmt"
)

type biology interface {
	isLive() bool
}

type animal struct {
	sound string
}

type dog struct {
	animal
	friendly bool
}

type cat struct {
	animal
	annoying bool
}

func (d dog) isLive() bool {
	return true
}

func (c cat) isLive() bool {
	return true
}

func main() {
	animals := make([]animal, 1, 2)
	animals2 := make([]biology, 1, 2)
	d := dog{
		animal:   animal{"woof"},
		friendly: true,
	}
	//编译不过
	//animals[0] = d

	animals2[0] = d
	//
	//c := cat{
	//	animal:   animal{"meow"},
	//	annoying: false,
	//}
	//animals[1] = c
	fmt.Println(animals)
	fmt.Println(animals2)

}
